package com.ssy.lingxi.product.service.platform;

import com.ssy.lingxi.common.model.dto.UserLoginCacheDTO;
import com.ssy.lingxi.common.model.vo.PageVO;
import com.ssy.lingxi.product.api.model.request.CategoryAttributeRequest;
import com.ssy.lingxi.product.api.model.request.CategoryAttributeSortRequest;
import com.ssy.lingxi.product.entity.platform.Attribute;
import org.springframework.data.domain.Page;

import java.util.List;

/**
 * 品类属性管理类
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/22
 */
public interface ICategoryAttributeService {

    /**
     * 查询属性
     * @param pageVO
     * @param name
     * @param categoryId
     * @param isByCategory
     * @return Wrapper<?>
     */
    Page<Attribute> getCategoryAttributeList(PageVO pageVO, String name, String groupName, Long categoryId, Boolean isByCategory);

    /**
     * 查询属性-MRO模式 按照特定的排序返回结果
     * @param name
     * @param categoryId
     * @param isByCategory
     * @return Wrapper<?>
     */
    List<Attribute> getMroCategoryAttributeList(String name, String groupName, Long categoryId, Boolean isByCategory);


    /**
     * 添加/修改品类
     * @param categoryAttributeRequest
     * @return
     * @throws Exception
     */
    String saveCategoryAttribute(CategoryAttributeRequest categoryAttributeRequest);

    /**
     * 删除品类属性
     * @param categoryAttributeRequest
     * @return
     */
    String deleteCategoryAttribute(CategoryAttributeRequest categoryAttributeRequest);

    /**
     * 新增/修改品类下的属性排序
     *
     * @param sysUser
     * @param categoryAttributeSortRequestList
     * @return
     */
    Boolean saveCategoryAttributeSort(UserLoginCacheDTO sysUser, List<CategoryAttributeSortRequest> categoryAttributeSortRequestList);
}
